import { createRouter, createWebHistory } from 'vue-router'
// import { routes } from '@/router/routes'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Index from '../views/Index.vue'
import OderDetail from '@/components/OderDetail.vue'
import MessageDeatil from '@/components/MessageDeatil.vue'


const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    // routes
    routes: [
        {
            path: '/',
            redirect: '/login',
        },
        {
            path: '/login',
            component: Login,
        },
        {
            path: '/home',
            component: Home,
            redirect: '/index',
            children: [
                {
                    path: '/index',
                    component: Index,
                    meta: { hidden: false },
                },
                {
                    path: '/orderDetail',
                    component: OderDetail,
                    meta:{title:'商品详情'}
                },
                {
                    path: '/messageDetail',
                    component: MessageDeatil,
                    meta:{title:'消息详情'}
                }
            ],
        }

    ],
})

export default router
